﻿<%@ Page Title="" Language="C#" MasterPageFile="~/DashBoard/Master/Main.Master" enableEventValidation="false" AutoEventWireup="true" CodeBehind="AkademisyenDersEkle.aspx.cs" Inherits="OgrIsleri.DashBoard.Modul.Dersler.AkademisyenDersEkle" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Main_Body" runat="server">
    <script type="text/javascript">
        $(function () {
            $("#BtnKaydet").click(function () {

                var adet = $("#<%=lbxDersAkademisyenleri.ClientID%> option").length;

                if (adet <= 0)
                    alert("Lütfen en az 1 akademisyen ekleyeniz");
                else {
                    var liste = "";
                    var eskiListe="";
                    var DersID=<%=Request.QueryString["DersID"]%>;

                    $("#<%=lbxDersAkademisyenleri.ClientID%> option").each(function () {
                        liste += $(this).val();
                        liste += ",";
                    });

                    $("#<%=lbxAkademisyenler.ClientID%> option").each(function () {
                        eskiListe += $(this).val();
                        eskiListe += ",";
                    });

                    liste = liste.substr(0, liste.length - 1);
                    eskiListe = eskiListe.substr(0, eskiListe.length - 1);
                    
                    $.ajax({ 
                        url: "AkademisyenDersEkle.aspx/AkdEkle", 
                        data: '{Liste:"' + liste + '",EskiListe:"'+eskiListe+'",DersID:"'+DersID+'"}', 
                        dataType: "json", 
                        type: "POST", 
                        contentType: "application/json; charset=utf-8",
                        success:function(msg)
                        {
                            location.href=document.referrer;
                        }
                    });

                }
            });
        });
    </script>
          
                <div class="widget">
                   
                    <div class="title"><img src="/images/icons/dark/transfer.png" alt="" class="titleIcon"><h6>..... Dersi Akademisyenleri</h6></div>
                    <div class="body">
                    <div class="leftPart">
                        <asp:ListBox ID="lbxAkademisyenler" multiple="multiple" class="multiple" runat="server" Height="300px"></asp:ListBox>
                        <br>
                        
                        <div class="dn"><div id="uniform-box1Storage" class="selector"><span style="-moz-user-select: none;"></span><select style="display: none; opacity: 0;" id="box1Storage" name="box1Storage"></select></div></div>
                    </div>
                        
                    <div class="dualControl">
                        <button id="to2" type="button" class="basic mr5 mb15">&nbsp;&gt;&nbsp;</button>
                        <button id="allTo2" type="button" class="basic">&nbsp;&gt;&gt;&nbsp;</button><br>
                        <button id="to1" type="button" class="basic mr5">&nbsp;&lt;&nbsp;</button>
                        <button id="allTo1" type="button" class="basic">&nbsp;&lt;&lt;&nbsp;</button>
                    </div>
                        
                    <div class="rightPart">
                        <asp:ListBox ID="lbxDersAkademisyenleri" multiple="multiple" class="multiple" runat="server" Height="300px"></asp:ListBox>
                        
                        <div class="dn"><div id="uniform-box2Storage" class="selector"><span style="-moz-user-select: none;"></span><select style="display: none; opacity: 0;" id="box2Storage"></select></div></div>
                    </div>
                    <div class="clear"></div>
                    </div>
                <div class="formRow">
                        <input id="BtnKaydet" class="button dblueB" type="button" value="Kaydet" />
                    </div>
                </div>


</asp:Content>
